home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_randomambient.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  84 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_RandomAmbient.cog
  4. #
  5. # Plays a random sound at random intervals with random volume and panning
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message            startup
  15.     message            timer
  16.     message         crossed
  17.  
  18.     thing           player
  19.     
  20.     surface         startsurf0          linkid=3
  21.     surface         startsurf1          linkid=3
  22.     
  23.     surface         stopsurf0           linkid=4
  24.     surface         stopsurf1           linkid=4
  25.         
  26.     sound            wav0
  27.     sound            wav1
  28.     sound            wav2
  29.     sound            wav3
  30.     sound           wav4
  31.     sound           wav5
  32.     sound           wav6
  33.     
  34.     int                numsounds
  35.  
  36.     flex            min_interval
  37.     flex            range_interval
  38.  
  39.     int                temp                local
  40.     int             sndchannel          local
  41.     
  42. end
  43.  
  44. code
  45.  
  46. # ........................................................................................
  47.  
  48. startup:
  49.  
  50.     player = GetLocalPlayerThing();
  51.     
  52. return;
  53.  
  54. # ........................................................................................
  55.  
  56. timer:
  57.  
  58.     temp = RandBetween(0, numsounds);
  59.     sndchannel = PlaySoundLocal(wav0[temp], Rand()+0.3, (RandBetween(0, 1) * -1), 0x0, 1);
  60.     SetTimerEX(RandBetween(min_interval, range_interval), 2, 0, 0);
  61.     
  62. return;
  63.     
  64. # ........................................................................................
  65.  
  66. crossed:
  67.     
  68.     If (GetSenderID() == 3)
  69.     {
  70.         SetTimerEx(RandBetween(min_interval, range_interval), 2, 0, 0);
  71.     }
  72.     
  73.     If (GetSenderID() == 4)
  74.     {
  75.         KillTimerEx(2);
  76.     }
  77.     
  78. return;        
  79.  
  80. # ........................................................................................
  81.  
  82. end
  83.  
  84.